package com.dhecp.project.api.mapper;

import com.dhecp.core.genericDao.GenericDao;
import com.dhecp.project.api.domain.AmazonShop;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName AmazonShopMapper
 * @Description TODO
 * @Author alula
 * @Date 2022-09-24 10:25
 */
public interface AmazonShopMapper extends GenericDao<AmazonShop, String> {

    List<AmazonShop> findAmazonShopList(Map<String, Object> params);

    List<AmazonShop> findGroupAmazonShopList(Map<String, Object> params);

    AmazonShop findAmazonShopByGuid(@Param("guid") String guid);

    /**
     * 更新店铺亚马逊订单最后同步时间
     * @param params
     * @return
     */
    int updateByLastOrderSyncDate(Map<String, Object> params);

    /**
     * 根据卖家ID和区域表GUID更新同大区下店铺授权状态
     * @param params
     * @return
     */
    int updateByAuthorizeState(Map<String, Object> params);

    /**
     * 更新店铺亚马逊TOKEN相关值
     * @param params
     * @return
     */
    int updateByAccessToken(Map<String, Object> params);

    /**
     * 更新店铺亚马逊GgTOKEN相关值
     * @param params
     * @return
     */
    int updateByAccessGgToken(Map<String, Object> params);

    AmazonShop findAmazonShopBySellerId(@Param("sellerId") String sellerId);
}
